﻿using System.Collections.Generic;

namespace Sharpmark.QQ.ChatLog
{

    public class Conversation : List<Message>
    {
        public string Peer { get; set; }

        public new void Add(Message item)
        {
            foreach (var i in this)
            {
                if (i.Equals(item)) return; // 忽略相同的消息
            }

            base.Add(item);
        }

        public List<Session> SessionList
        {
            get { return null; }
        }
        //private class ConversationCompare : IComparer<Message>
        //{
        //    public int Compare(Message x, Message y)
        //    {
        //        return x.DateTime.CompareTo(y.DateTime);
        //    }
        //}

        //public new void Sort()
        //{
        //    Sort(new SessionCompare());
        //}
    }
}
